<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let game ={}

        // 向对象添加方法 up down
        // 声明一个对象
        let methods = {
            up:Symbol(),
            down:Symbol()
        };

        // Symbol作为对象属性名时,不能用点运算符.在对象内部,使用Symbol值定义属性时,Symbol值必须放在方括号之中
        // 例如game[methods.down ] game[methods.down]
    // game[methods.up ] =function(){
    //     console.log('我可以改变形状');
    // }

    // game[methods.down] = function(){
    //     console.log('我可以快速下降');
    // }

    let youxi ={
        name:'狼人杀',
        [Symbol('say')]:function(){
            console.log('我可以发言');
        },
        [Symbol('zibao')]:function(){
            console.log('我可以自爆');
        }

       
    }
    console.log(youxi);
    </script>
</body>
</html>